/*
*
==============================================================================
*  Name        : 
*  Part of     : Omen Game Engine - DirectX 10 Plugin
*  Description : 
*  Version     : 1.0
*
*  Copyright (c) 2013 Lauri Kortevaara.
* 
==============================================================================
*/

#ifndef _DirectX_10_LightShader_H_
#define _DirectX_10_LightShader_H_


//////////////
// INCLUDES //
//////////////
#include <d3d10.h>
#include <d3dx10math.h>
#include <fstream>
using namespace std;

namespace Omen {

    ////////////////////////////////////////////////////////////////////////////////
    // Class name: DirectX_10_LightShader
    ////////////////////////////////////////////////////////////////////////////////
    class DirectX_10_LightShader
    {
    public:
        DirectX_10_LightShader();
        DirectX_10_LightShader(const DirectX_10_LightShader&);
        ~DirectX_10_LightShader();

        bool Initialize( ID3D10Device*, HWND);
        void Shutdown();
        void Render( ID3D10Device*, int, D3DXMATRIX, D3DXMATRIX, D3DXMATRIX, ID3D10ShaderResourceView*, D3DXVECTOR3, D3DXVECTOR4);

    private:
        bool InitializeShader( ID3D10Device*, HWND, WCHAR*);
        void ShutdownShader();
        void OutputShaderErrorMessage( ID3D10Blob*, HWND, WCHAR*);

        void SetShaderParameters(D3DXMATRIX, D3DXMATRIX, D3DXMATRIX, ID3D10ShaderResourceView*, D3DXVECTOR3, D3DXVECTOR4);
        void RenderShader( ID3D10Device*, int);

    private:
        ID3D10Effect*               m_effect;
        ID3D10EffectTechnique*      m_technique;
        ID3D10InputLayout*          m_layout;

        ID3D10EffectMatrixVariable*         m_worldMatrixPtr;
        ID3D10EffectMatrixVariable*         m_viewMatrixPtr;
        ID3D10EffectMatrixVariable*         m_projectionMatrixPtr;
        ID3D10EffectShaderResourceVariable* m_pTexturePtr;
        ID3D10EffectVectorVariable*         m_lightDirectionPtr;
        ID3D10EffectVectorVariable*         m_diffuseColorPtr;
    };

} // namespace Omen

#endif